           package com.java.diagnostics.visualizer.impl.data;
           
           import com.java.diagnostics.visualizer.data.Data;
           import com.java.diagnostics.visualizer.data.ids.ID;
           
           public abstract class DataImpl
             implements Data
           {
             protected static final String EMPTY_COMMENT = "";
             protected String label;
             private ID id;
             private String comment = "";
           
             protected DataImpl() {
             }
           
             protected DataImpl(String label) {
               this.label = label;
           
               this.id = null;
             }
           
             public String getLabel() {
               return this.label;
             }
           
             public final ID getID() {
               if (this.id == null) {
                 this.id = generateID();
               }
               return this.id;
             }
           
             protected abstract ID generateID();
           
             public int compareTo(Object obj) {
               if ((obj instanceof Data)) {
                 ID compareToID = ((Data)obj).getID();
                 return getID().compareTo(compareToID);
               }
           
               return getID().compareTo(obj.toString());
             }
           
             public String getComment()
             {
               return this.comment;
             }
           
             public void setComment(String comment) {
               this.comment = comment;
             }
           }

